<?php
/**
 * 海外仓-移库库存换标日志
 * (model)
 */
namespace App\Models\OverSeasBa;

use Encore\Admin\Facades\Admin;
use Illuminate\Database\Eloquent\Model;
class RemovaleFnSkuTranLog extends Model
{
    protected $table = 'os_b_removale_fnsku_tran_log';

    protected $guarded = [];

    public static function logs($warehouseId,$account = [],$fnsku = [],$transferNum = 0,$userId = null){
        self::create(['warehouse_id' => $warehouseId,
            'oaccount_id' => $account['o'],
            'iaccount_id' => $account['i'],
            'ofnsku' => $fnsku['o'],
            'ifnsku' => $fnsku['i'],
            'transfer_num' => $transferNum,
            'ouser_id' => $userId ?: Admin::user()->id]);
    }
}
